// Promise的静态方法

// Promise.all()
// Promise.race()

const fs = require('fs')

let p1 = new Promise(function (resolve, reject) {
    fs.readFile('./files/1.txt', 'utf-8', (err, data) => {
        if (err) {
            return reject(err)
        }
        resolve(data)
    })
})

let p2 = new Promise(function (resolve, reject) {
    fs.readFile('./files/2.txt', 'utf-8', (err, data) => {
        if (err) {
            return reject(err)
        }
        resolve(data)
    })
})

let p3 = new Promise(function (resolve, reject) {
    fs.readFile('./files/3.txt', 'utf-8', (err, data) => {
        if (err) {
            return reject(err)
        }
        resolve(data)
    })
})
